<form method="post">
<table class="table table-striped table-hover">
  <tr>
    <th></th>
    {foreach from=$aRole item=role}
    <th>{$role.role_title}</th>
    {/foreach}
  </tr>
{foreach from=$aModulePerm item=aPerm key=module}
  <tr class="row1">
    <td colspan="{$colSpan}"><strong>{$module}</strong></td>
  </tr>
  {foreach from=$aPerm item=r key=perm}
  <tr>
    <td>{$perm}</td>
    {foreach from=$aRole item=role}
    <td class="center"><input type="checkbox" name="{$role.role_id}[{$perm}]" {if $aRolePerm[$role.role_id][$module][$perm]}checked="checked"{/if} /></td>
    {/foreach}
  </tr>
  {/foreach}
{/foreach}
<tr class="row1">
  <td colspan="{$colSpan}"><input type="submit" value="Cập nhật" /></td>
</tr>
</table>
</form>